import { _decorator, Component, Node, Sprite, SpriteFrame } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('NextBlock')
export class NextBlock extends Component {

    @property([SpriteFrame])
    nextBlockSkins: SpriteFrame[] = [];

    start() {

    }

    public initBlock(isShow: boolean) {
        this.node.active = isShow;
    }

    public setBlock(seatId: number, isShow: boolean) {
        this.node.active = isShow;
        if (!isShow) return;
        if (seatId > 0 && seatId < 5) {
            this.node.getComponent(Sprite).spriteFrame = this.nextBlockSkins[seatId - 1];
        } else {
            this.node.active = false;
        }
    }

    update(deltaTime: number) {

    }
}


